# -*- coding:utf-8 -*-

#导入redis
# import redis
# from flask import  session
# #使用数据库需要导入的模块
# from flask_sqlalchemy import SQLAlchemy
# #使用csrf_token保护验证导入的模块
# from flask_wtf.csrf import CSRFProtect
# #将session保存到redis中
# from flask_session import Session
#数据库迁移导入的模块
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
# from config import Config
from iHome import create_app, db
#引用模型
from iHome import models


#config['development']
#根据传入不同的配置名字，区创建不同配置的app
app = create_app('development')


@app.route('/123')
def aaa():
    return 'aaaaaaa'
manager = Manager(app)
#集成数据库迁移
Migrate(app, db)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    #app.run()
    print app.url_map
    manager.run()
